//
//  CHScrollView.m
//  CHSimpleUI
//
//  Created by cyptt on 2022/7/14.
//

#import "CHScrollView.h"

@interface CHScrollView ()<UIScrollViewDelegate>

@end

@implementation CHScrollView


-(instancetype)initWithFrame:(CGRect)frame{
    if ( self = [super initWithFrame:frame]) {
        self.delegate = self;
    }
    return  self;
}


//滚动视图减速完成，滚动将停止时，调用该方法。一次有效滑动，只执行一次
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView;{

    int index = 0;
    
    index = (scrollView.contentOffset.x/self.frame.size.width);
   
    [self.signChoiseView setIndex:index];
}

@end
